﻿<Application xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
             xmlns:vsm="clr-namespace:System.Windows;assembly=System.Windows" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" mc:Ignorable="d" 
             x:Class="RubikCube.App"
             >
    <Application.Resources>
            <!--************** Caramel styles begin ************** -->
            <SolidColorBrush x:Key="YBorderDark" Color="#FFCD5903"/>
            <SolidColorBrush x:Key="YBorderLight" Color="#FFFFB600"/>
            <SolidColorBrush x:Key="YFocusColor" Color="#FFFFFBAE"/>
            <LinearGradientBrush x:Key="YFillBrush" EndPoint="0.64,0.88" StartPoint="0.62,0.15">
                <GradientStop Color="#FFFCD92D" Offset="0"/>
                <GradientStop Color="#FFFFFBAE" Offset="1"/>
            </LinearGradientBrush>
            <LinearGradientBrush x:Key="YColorDarkLight" EndPoint=".7,1" StartPoint=".7,0">
                <GradientStop Color="#FFFFFBAE" Offset="1"/>
                <GradientStop Color="#FFFCD92D" Offset="0.21"/>
            </LinearGradientBrush>
            <LinearGradientBrush x:Key="YColorDarkLightOver" EndPoint=".7,1" StartPoint=".7,0">
                <GradientStop Color="#FFFCD92D" Offset="0"/>
                <GradientStop Color="#FFFFFBAE" Offset="0.7"/>
            </LinearGradientBrush>
            <LinearGradientBrush x:Key="YLightBack" EndPoint=".7,1" StartPoint=".7,0">
                <GradientStop Color="#FFFFFFFF" Offset="0"/>
                <GradientStop Color="#FFFCD92D" Offset="1"/>
            </LinearGradientBrush>
            <LinearGradientBrush x:Key="YLightBackDown" EndPoint="0.7,0" StartPoint="0.7,1">
                <GradientStop Color="#FFFFFFFF"/>
                <GradientStop Color="#FFFFFBAE" Offset="1"/>
            </LinearGradientBrush>
            <LinearGradientBrush x:Key="YLightVertical" EndPoint="0,0.5" StartPoint="1,0.5">
                <GradientStop Color="#FFFFFFFF" Offset="0"/>
                <GradientStop Color="#FFFFFBAE" Offset="1"/>
            </LinearGradientBrush>
            <LinearGradientBrush x:Key="YSlideHorisontal" EndPoint="1,0.5" StartPoint="0,0.5">
                <GradientStop Color="#FFFCD92D"/>
                <GradientStop Color="#FFFFFBAE" Offset="1"/>
            </LinearGradientBrush>
            <SolidColorBrush x:Key="YTextColor" Color="#FFCD5903"/>

        <Style x:Key="ButtonCaramel" TargetType="Button">
                <Setter Property="Padding" Value="3"/>
                <Setter Property="BorderThickness" Value="1"/>
                <Setter Property="Template">
                    <Setter.Value>
                        <ControlTemplate TargetType="Button">
                            <Grid>
                                <vsm:VisualStateManager.VisualStateGroups>
                                    <vsm:VisualStateGroup x:Name="CommonStates">
                                        <vsm:VisualStateGroup.Transitions>
                                            <vsm:VisualTransition GeneratedDuration="00:00:00.1" To="MouseOver"/>
                                            <vsm:VisualTransition GeneratedDuration="00:00:00.1" To="Pressed"/>
                                        </vsm:VisualStateGroup.Transitions>
                                        <vsm:VisualState x:Name="Normal"/>
                                        <vsm:VisualState x:Name="MouseOver">
                                            <Storyboard>
                                                <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="Highlight" Storyboard.TargetProperty="(UIElement.Opacity)">
                                                    <SplineDoubleKeyFrame KeyTime="00:00:00" Value="1"/>
                                                </DoubleAnimationUsingKeyFrames>
                                            </Storyboard>
                                        </vsm:VisualState>
                                        <vsm:VisualState x:Name="Pressed">
                                            <Storyboard>
                                                <DoubleAnimationUsingKeyFrames Storyboard.TargetName="Highlight" Storyboard.TargetProperty="Opacity">
                                                    <SplineDoubleKeyFrame KeyTime="0" Value="1"/>
                                                </DoubleAnimationUsingKeyFrames>
                                                <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="contentPresenter" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.Y)">
                                                    <SplineDoubleKeyFrame KeyTime="00:00:00" Value="2.5"/>
                                                </DoubleAnimationUsingKeyFrames>
                                            </Storyboard>
                                        </vsm:VisualState>
                                        <vsm:VisualState x:Name="Disabled">
                                            <Storyboard>
                                                <DoubleAnimationUsingKeyFrames Storyboard.TargetName="DisabledVisualElement" Storyboard.TargetProperty="(UIElement.Opacity)">
                                                    <SplineDoubleKeyFrame KeyTime="0" Value="1"/>
                                                </DoubleAnimationUsingKeyFrames>
                                            </Storyboard>
                                        </vsm:VisualState>
                                    </vsm:VisualStateGroup>
                                    <vsm:VisualStateGroup x:Name="FocusStates">
                                        <vsm:VisualState x:Name="Focused">
                                            <Storyboard>
                                                <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="FocusVisualElement" Storyboard.TargetProperty="Visibility">
                                                    <DiscreteObjectKeyFrame KeyTime="0">
                                                        <DiscreteObjectKeyFrame.Value>
                                                            <Visibility>Visible</Visibility>
                                                        </DiscreteObjectKeyFrame.Value>
                                                    </DiscreteObjectKeyFrame>
                                                </ObjectAnimationUsingKeyFrames>
                                            </Storyboard>
                                        </vsm:VisualState>
                                        <vsm:VisualState x:Name="Unfocused"/>
                                    </vsm:VisualStateGroup>
                                </vsm:VisualStateManager.VisualStateGroups>
                                <Border Margin="{TemplateBinding BorderThickness}" x:Name="BackgroundGradient" CornerRadius="5" Background="{StaticResource YColorDarkLight}"/>
                                <Border Margin="{TemplateBinding BorderThickness}" x:Name="Highlight" IsHitTestVisible="false" Opacity="0" BorderThickness="1" CornerRadius="1.75" Background="{StaticResource YColorDarkLightOver}"/>
                                <Grid Margin="2" x:Name="CurvedBevelScale">
                                    <Grid.RowDefinitions>
                                        <RowDefinition Height="7*"/>
                                        <RowDefinition Height="3*"/>
                                    </Grid.RowDefinitions>
                                    <Path Margin="0,0,0,0" x:Name="CurvedBevel"  Stretch="Fill" Data="F1 M 311.792,50.0002L 397.792,50.0002C 400.553,50.0002 402.792,52.2387 402.792,55.0002L 402.792,65.0001C 402.792,67.7615 400.553,70.0001 397.792,70.0001C 383.528,67.6113 380.092,62.8334 355,62.8334C 329.908,62.8334 326.195,67.6113 311.792,70.0001C 309.03,70.0001 306.792,67.7615 306.792,65.0001L 306.792,55.0002C 306.792,52.2387 309.03,50.0002 311.792,50.0002 Z ">
                                        <Path.Fill>
                                            <LinearGradientBrush StartPoint="0.5,0" EndPoint="0.5,1">
                                                <LinearGradientBrush.GradientStops>
                                                    <GradientStop Color="#E5FFFFFF" Offset="0"/>
                                                    <GradientStop Color="#00FFFFFF" Offset="1"/>
                                                </LinearGradientBrush.GradientStops>
                                            </LinearGradientBrush>
                                        </Path.Fill>
                                    </Path>
                                </Grid>
                                <ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" x:Name="contentPresenter" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" Content="{TemplateBinding Content}" ContentTemplate="{TemplateBinding ContentTemplate}" RenderTransformOrigin="0.5,0.5">
                                    <ContentPresenter.RenderTransform>
                                        <TransformGroup>
                                            <ScaleTransform/>
                                            <SkewTransform/>
                                            <RotateTransform/>
                                            <TranslateTransform/>
                                        </TransformGroup>
                                    </ContentPresenter.RenderTransform>
                                </ContentPresenter>
                                <Border x:Name="DisabledVisualElement" IsHitTestVisible="false" Opacity="0" Background="#A5FFFFFF" CornerRadius="5"/>
                                <Border x:Name="FocusVisualElement" IsHitTestVisible="false" Visibility="Collapsed" BorderBrush="{StaticResource YFocusColor}" BorderThickness="1" CornerRadius="5"/>
                            </Grid>
                        </ControlTemplate>
                    </Setter.Value>
                </Setter>
            </Style>
            <Style x:Key="ButtonCaramelFlow" TargetType="Button">
                <Setter Property="Padding" Value="3"/>
                <Setter Property="BorderThickness" Value="1"/>
                <Setter Property="Template">
                    <Setter.Value>
                        <ControlTemplate TargetType="Button">
                            <Grid>
                                <vsm:VisualStateManager.VisualStateGroups>
                                    <vsm:VisualStateGroup x:Name="CommonStates">
                                        <vsm:VisualStateGroup.Transitions>
                                            <vsm:VisualTransition GeneratedDuration="00:00:00.1" To="MouseOver"/>
                                            <vsm:VisualTransition GeneratedDuration="00:00:00.1" To="Pressed"/>
                                        </vsm:VisualStateGroup.Transitions>
                                        <vsm:VisualState x:Name="Normal"/>
                                        <vsm:VisualState x:Name="MouseOver">
                                            <Storyboard>
                                                <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="Highlight" Storyboard.TargetProperty="(UIElement.Opacity)">
                                                    <SplineDoubleKeyFrame KeyTime="00:00:00" Value="1"/>
                                                </DoubleAnimationUsingKeyFrames>
                                            </Storyboard>
                                        </vsm:VisualState>
                                        <vsm:VisualState x:Name="Pressed">
                                            <Storyboard>
                                                <DoubleAnimationUsingKeyFrames Storyboard.TargetName="Highlight" Storyboard.TargetProperty="Opacity">
                                                    <SplineDoubleKeyFrame KeyTime="0" Value="1"/>
                                                </DoubleAnimationUsingKeyFrames>
                                                <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="contentPresenter" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.Y)">
                                                    <SplineDoubleKeyFrame KeyTime="00:00:00" Value="-1.75"/>
                                                </DoubleAnimationUsingKeyFrames>
                                            </Storyboard>
                                        </vsm:VisualState>
                                        <vsm:VisualState x:Name="Disabled">
                                            <Storyboard>
                                                <DoubleAnimationUsingKeyFrames Storyboard.TargetName="DisabledVisualElement" Storyboard.TargetProperty="(UIElement.Opacity)">
                                                    <SplineDoubleKeyFrame KeyTime="0" Value="1"/>
                                                </DoubleAnimationUsingKeyFrames>
                                            </Storyboard>
                                        </vsm:VisualState>
                                    </vsm:VisualStateGroup>
                                    <vsm:VisualStateGroup x:Name="FocusStates">
                                        <vsm:VisualState x:Name="Focused">
                                            <Storyboard>
                                                <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="FocusVisualElement" Storyboard.TargetProperty="Visibility">
                                                    <DiscreteObjectKeyFrame KeyTime="0">
                                                        <DiscreteObjectKeyFrame.Value>
                                                            <Visibility>Visible</Visibility>
                                                        </DiscreteObjectKeyFrame.Value>
                                                    </DiscreteObjectKeyFrame>
                                                </ObjectAnimationUsingKeyFrames>
                                            </Storyboard>
                                        </vsm:VisualState>
                                        <vsm:VisualState x:Name="Unfocused"/>
                                    </vsm:VisualStateGroup>
                                </vsm:VisualStateManager.VisualStateGroups>
                                <Path x:Name="BackgroundGradient" Stretch="Fill" Data="F1 M 310,93.0505L 400,93.0505C 402.761,93.0505 405,95.2891 405,98.0505L 405,118.051C 405,120.812 402.761,123.051 400,123.051L 328.423,123.05L 323.473,128L 318.523,123.05L 310,123.051C 307.239,123.051 305,120.812 305,118.051L 305,98.0505C 305,95.2891 307.239,93.0505 310,93.0505 Z " Fill="{StaticResource YColorDarkLight}"/>
                                <Path x:Name="Highlight" Stretch="Fill" Opacity="0" Data="F1 M 310,93.0505L 400,93.0505C 402.761,93.0505 405,95.2891 405,98.0505L 405,118.051C 405,120.812 402.761,123.051 400,123.051L 328.423,123.05L 323.473,128L 318.523,123.05L 310,123.051C 307.239,123.051 305,120.812 305,118.051L 305,98.0505C 305,95.2891 307.239,93.0505 310,93.0505 Z " Fill="{StaticResource YColorDarkLightOver}" />
                                <Grid Margin="2" x:Name="CurvedBevelScale">
                                    <Grid.RowDefinitions>
                                        <RowDefinition Height="7*"/>
                                        <RowDefinition Height="3*"/>
                                    </Grid.RowDefinitions>
                                    <Path Margin="0,0,0,0" x:Name="CurvedBevel"  Stretch="Fill" Data="F1 M 311.792,50.0002L 397.792,50.0002C 400.553,50.0002 402.792,52.2387 402.792,55.0002L 402.792,65.0001C 402.792,67.7615 400.553,70.0001 397.792,70.0001C 383.528,67.6113 380.092,62.8334 355,62.8334C 329.908,62.8334 326.195,67.6113 311.792,70.0001C 309.03,70.0001 306.792,67.7615 306.792,65.0001L 306.792,55.0002C 306.792,52.2387 309.03,50.0002 311.792,50.0002 Z ">
                                        <Path.Fill>
                                            <LinearGradientBrush StartPoint="0.5,0" EndPoint="0.5,1">
                                                <LinearGradientBrush.GradientStops>
                                                    <GradientStop Color="#E5FFFFFF" Offset="0"/>
                                                    <GradientStop Color="#00FFFFFF" Offset="1"/>
                                                </LinearGradientBrush.GradientStops>
                                            </LinearGradientBrush>
                                        </Path.Fill>
                                    </Path>
                                </Grid>
                                <ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" x:Name="contentPresenter" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" Content="{TemplateBinding Content}" ContentTemplate="{TemplateBinding ContentTemplate}" RenderTransformOrigin="0.5,0.5">
                                    <ContentPresenter.RenderTransform>
                                        <TransformGroup>
                                            <ScaleTransform/>
                                            <SkewTransform/>
                                            <RotateTransform/>
                                            <TranslateTransform/>
                                        </TransformGroup>
                                    </ContentPresenter.RenderTransform>
                                </ContentPresenter>
                                <Path x:Name="DisabledVisualElement" Stretch="Fill" Opacity="0" Data="F1 M 310,93.0505L 400,93.0505C 402.761,93.0505 405,95.2891 405,98.0505L 405,118.051C 405,120.812 402.761,123.051 400,123.051L 328.423,123.05L 323.473,128L 318.523,123.05L 310,123.051C 307.239,123.051 305,120.812 305,118.051L 305,98.0505C 305,95.2891 307.239,93.0505 310,93.0505 Z " Fill="#A5FFFFFF" />
                                <Path x:Name="FocusVisualElement" Stretch="Fill" Opacity="1" Data="F1 M 310,93.0505L 400,93.0505C 402.761,93.0505 405,95.2891 405,98.0505L 405,118.051C 405,120.812 402.761,123.051 400,123.051L 328.423,123.05L 323.473,128L 318.523,123.05L 310,123.051C 307.239,123.051 305,120.812 305,118.051L 305,98.0505C 305,95.2891 307.239,93.0505 310,93.0505 Z " Fill="#00FFFFFF" Visibility="Collapsed" Stroke="{StaticResource YFocusColor}" />
                            </Grid>
                        </ControlTemplate>
                    </Setter.Value>
                </Setter>
            </Style>

      
      
            <Style x:Key="TextBoxCaramel" TargetType="TextBox">
                <Setter Property="BorderThickness" Value="1"/>
                <Setter Property="Padding" Value="2"/>
                <Setter Property="Template">
                    <Setter.Value>
                        <ControlTemplate TargetType="TextBox">
                            <Grid x:Name="RootElement">
                                <vsm:VisualStateManager.VisualStateGroups>
                                    <vsm:VisualStateGroup x:Name="CommonStates">
                                        <vsm:VisualStateGroup.Transitions>
                                            <vsm:VisualTransition GeneratedDuration="00:00:00.1" To="MouseOver"/>
                                            <vsm:VisualTransition GeneratedDuration="00:00:00.1" To="ReadOnly"/>
                                            <vsm:VisualTransition GeneratedDuration="00:00:00.1" To="Disabled"/>
                                        </vsm:VisualStateGroup.Transitions>
                                        <vsm:VisualState x:Name="Normal"/>
                                        <vsm:VisualState x:Name="MouseOver">
                                            <Storyboard>
                                                <ColorAnimationUsingKeyFrames Storyboard.TargetName="MouseOverColor" Storyboard.TargetProperty="Color">
                                                    <SplineColorKeyFrame KeyTime="0" Value="#FFCCBFB6"/>
                                                </ColorAnimationUsingKeyFrames>
                                            </Storyboard>
                                        </vsm:VisualState>
                                        <vsm:VisualState x:Name="Disabled">
                                            <Storyboard>
                                                <DoubleAnimationUsingKeyFrames Storyboard.TargetName="DisabledVisualElement" Storyboard.TargetProperty="Opacity">
                                                    <SplineDoubleKeyFrame KeyTime="0" Value=".7"/>
                                                </DoubleAnimationUsingKeyFrames>
                                            </Storyboard>
                                        </vsm:VisualState>
                                        <vsm:VisualState x:Name="ReadOnly">
                                            <Storyboard>
                                                <DoubleAnimationUsingKeyFrames Storyboard.TargetName="ReadOnlyVisualElement" Storyboard.TargetProperty="Opacity">
                                                    <SplineDoubleKeyFrame KeyTime="0" Value="1"/>
                                                </DoubleAnimationUsingKeyFrames>
                                            </Storyboard>
                                        </vsm:VisualState>
                                    </vsm:VisualStateGroup>
                                    <vsm:VisualStateGroup x:Name="FocusStates">
                                        <vsm:VisualState x:Name="Focused">
                                            <Storyboard>
                                                <DoubleAnimationUsingKeyFrames Storyboard.TargetName="FocusVisualElement" Storyboard.TargetProperty="Opacity">
                                                    <SplineDoubleKeyFrame KeyTime="0" Value="1"/>
                                                </DoubleAnimationUsingKeyFrames>
                                            </Storyboard>
                                        </vsm:VisualState>
                                        <vsm:VisualState x:Name="Unfocused">
                                            <Storyboard>
                                                <DoubleAnimationUsingKeyFrames Storyboard.TargetName="FocusVisualElement" Storyboard.TargetProperty="Opacity">
                                                    <SplineDoubleKeyFrame KeyTime="0" Value="0"/>
                                                </DoubleAnimationUsingKeyFrames>
                                            </Storyboard>
                                        </vsm:VisualState>
                                    </vsm:VisualStateGroup>
                                </vsm:VisualStateManager.VisualStateGroups>
                                <Border x:Name="Border" Opacity="1" Background="{TemplateBinding Background}" BorderBrush="{StaticResource YBorderDark}" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="3">
                                    <Grid>
                                        <Border x:Name="ReadOnlyVisualElement" Opacity="0" Background="#72F7F7F7"/>
                                        <Border BorderThickness="1" CornerRadius="3,3,3,3">
                                            <Border.BorderBrush>
                                                <SolidColorBrush Color="Transparent" x:Name="MouseOverColor"/>
                                            </Border.BorderBrush>
                                            <ScrollViewer BorderThickness="0" IsTabStop="False" Padding="{TemplateBinding Padding}" x:Name="ContentElement" BorderBrush="{StaticResource YFocusColor}" Style="{StaticResource ScrollViewerCaramel}"/>
                                        </Border>
                                    </Grid>
                                </Border>
                                <Border x:Name="DisabledVisualElement" IsHitTestVisible="False" Opacity="0" Background="#A5F7F7F7" BorderBrush="{StaticResource YBorderDark}" BorderThickness="{TemplateBinding BorderThickness}"/>
                                <Border Margin="0,0,0,0" x:Name="FocusVisualElement" IsHitTestVisible="False" Opacity="0" BorderBrush="{StaticResource YFocusColor}" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="3"/>
                            </Grid>
                        </ControlTemplate>
                    </Setter.Value>
                </Setter>
            </Style>

                  <Style x:Key="SliderCaramel" TargetType="Slider">
                <Setter Property="BorderThickness" Value="1"/>
                <Setter Property="Maximum" Value="10"/>
                <Setter Property="Minimum" Value="0"/>
                <Setter Property="Value" Value="0"/>
                <Setter Property="IsTabStop" Value="False"/>
                <Setter Property="Template">
                    <Setter.Value>
                        <ControlTemplate TargetType="Slider">
                            <Grid x:Name="Root">
                                <Grid.Resources>
                                    <ControlTemplate x:Key="RepeatButtonTemplate">
                                        <Grid x:Name="Root" Background="Transparent" Opacity="0"/>
                                    </ControlTemplate>
                                </Grid.Resources>
                                <vsm:VisualStateManager.VisualStateGroups>
                                    <vsm:VisualStateGroup x:Name="CommonStates">
                                        <vsm:VisualState x:Name="Normal"/>
                                        <vsm:VisualState x:Name="MouseOver"/>
                                        <vsm:VisualState x:Name="Disabled">
                                            <Storyboard>
                                                <DoubleAnimationUsingKeyFrames Storyboard.TargetName="Root" Storyboard.TargetProperty="(UIElement.Opacity)">
                                                    <SplineDoubleKeyFrame KeyTime="0" Value="0.5"/>
                                                </DoubleAnimationUsingKeyFrames>
                                            </Storyboard>
                                        </vsm:VisualState>
                                    </vsm:VisualStateGroup>
                                </vsm:VisualStateManager.VisualStateGroups>
                                <Grid x:Name="HorizontalTemplate" Background="{TemplateBinding Background}">
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition Width="Auto"/>
                                        <ColumnDefinition Width="Auto"/>
                                        <ColumnDefinition Width="*"/>
                                    </Grid.ColumnDefinitions>
                                    <Rectangle Height="3" Margin="5,0,5,0" Grid.Column="0" Grid.ColumnSpan="3" Stroke="{StaticResource YBorderDark}" StrokeThickness="0.5" RadiusX="1" RadiusY="1" Fill="{StaticResource YSlideHorisontal}"/>
                                    <RepeatButton IsTabStop="False" Template="{StaticResource RepeatButtonTemplate}" x:Name="HorizontalTrackLargeChangeDecreaseRepeatButton" Grid.Column="0"/>
                                    <Thumb IsTabStop="True" Height="18" x:Name="HorizontalThumb" Width="11" Grid.Column="1" Style="{StaticResource ThumbCaramel}"/>
                                    <RepeatButton IsTabStop="False" Template="{StaticResource RepeatButtonTemplate}" x:Name="HorizontalTrackLargeChangeIncreaseRepeatButton" Grid.Column="2"/>
                                </Grid>
                                <Grid x:Name="VerticalTemplate" Background="{TemplateBinding Background}" Visibility="Collapsed">
                                    <Grid.RowDefinitions>
                                        <RowDefinition Height="*"/>
                                        <RowDefinition Height="Auto"/>
                                        <RowDefinition Height="Auto"/>
                                    </Grid.RowDefinitions>
                                    <Rectangle Margin="0,5,0,5" Width="3" Grid.Row="0" Grid.RowSpan="3" Fill="{StaticResource YSlideHorisontal}" Stroke="{StaticResource YBorderDark}" StrokeThickness="{TemplateBinding BorderThickness}" RadiusX="1" RadiusY="1"/>
                                    <RepeatButton IsTabStop="False" Template="{StaticResource RepeatButtonTemplate}" x:Name="VerticalTrackLargeChangeDecreaseRepeatButton" Grid.Row="2"/>
                                    <Thumb IsTabStop="True" Height="11" x:Name="VerticalThumb" Width="18" Grid.Row="1" Style="{StaticResource ThumbCaramel}"/>
                                    <RepeatButton IsTabStop="False" Template="{StaticResource RepeatButtonTemplate}" x:Name="VerticalTrackLargeChangeIncreaseRepeatButton" Grid.Row="0"/>
                                </Grid>
                            </Grid>
                        </ControlTemplate>
                    </Setter.Value>
                </Setter>
            </Style>


            <Style x:Key="ComboBoxCaramel" TargetType="ComboBox">
                <Setter Property="Padding" Value="6,2,25,2"/>
                <Setter Property="HorizontalContentAlignment" Value="Left"/>
                <Setter Property="BorderThickness" Value="1"/>
                <Setter Property="TabNavigation" Value="Once"/>
                <Setter Property="Template">
                    <Setter.Value>
                        <ControlTemplate TargetType="ComboBox">
                            <Grid>
                                <Grid.Resources>
                                    <Style TargetType="ToggleButton" x:Name="comboToggleStyle">
                                        <Setter Property="BorderThickness" Value="1"/>
                                        <Setter Property="Padding" Value="3"/>
                                        <Setter Property="Template">
                                            <Setter.Value>
                                                <ControlTemplate TargetType="ToggleButton">
                                                    <Grid>
                                                        <vsm:VisualStateManager.VisualStateGroups>
                                                            <vsm:VisualStateGroup x:Name="CommonStates">
                                                                <vsm:VisualStateGroup.Transitions>
                                                                    <vsm:VisualTransition GeneratedDuration="00:00:00.1" To="MouseOver"/>
                                                                    <vsm:VisualTransition GeneratedDuration="00:00:00.1" To="Pressed"/>
                                                                </vsm:VisualStateGroup.Transitions>
                                                                <vsm:VisualState x:Name="Normal"/>
                                                                <vsm:VisualState x:Name="MouseOver">
                                                                    <Storyboard>
                                                                        <DoubleAnimationUsingKeyFrames Storyboard.TargetName="BackgroundOverlay" Storyboard.TargetProperty="Opacity">
                                                                            <SplineDoubleKeyFrame KeyTime="0" Value="1"/>
                                                                        </DoubleAnimationUsingKeyFrames>
                                                                    </Storyboard>
                                                                </vsm:VisualState>
                                                                <vsm:VisualState x:Name="Pressed">
                                                                    <Storyboard>
                                                                        <DoubleAnimationUsingKeyFrames Storyboard.TargetName="BackgroundOverlay2" Storyboard.TargetProperty="Opacity">
                                                                            <SplineDoubleKeyFrame KeyTime="0" Value="1"/>
                                                                        </DoubleAnimationUsingKeyFrames>
                                                                        <DoubleAnimationUsingKeyFrames Storyboard.TargetName="Highlight" Storyboard.TargetProperty="(UIElement.Opacity)">
                                                                            <SplineDoubleKeyFrame KeyTime="0" Value="1"/>
                                                                        </DoubleAnimationUsingKeyFrames>
                                                                    </Storyboard>
                                                                </vsm:VisualState>
                                                                <vsm:VisualState x:Name="Disabled">
                                                                    <Storyboard>
                                                                        <DoubleAnimationUsingKeyFrames Storyboard.TargetName="DisabledVisualElement" Storyboard.TargetProperty="(UIElement.Opacity)">
                                                                            <SplineDoubleKeyFrame KeyTime="0" Value="1"/>
                                                                        </DoubleAnimationUsingKeyFrames>
                                                                    </Storyboard>
                                                                </vsm:VisualState>
                                                            </vsm:VisualStateGroup>
                                                            <vsm:VisualStateGroup x:Name="CheckStates">
                                                                <vsm:VisualState x:Name="Checked">
                                                                    <Storyboard>
                                                                        <DoubleAnimationUsingKeyFrames Storyboard.TargetName="BackgroundOverlay3" Storyboard.TargetProperty="(UIElement.Opacity)">
                                                                            <SplineDoubleKeyFrame KeyTime="0" Value="1"/>
                                                                        </DoubleAnimationUsingKeyFrames>
                                                                        <DoubleAnimationUsingKeyFrames Storyboard.TargetName="Highlight" Storyboard.TargetProperty="(UIElement.Opacity)">
                                                                            <SplineDoubleKeyFrame KeyTime="0" Value="1"/>
                                                                        </DoubleAnimationUsingKeyFrames>
                                                                        <DoubleAnimationUsingKeyFrames Storyboard.TargetName="BackgroundGradient2" Storyboard.TargetProperty="(UIElement.Opacity)">
                                                                            <SplineDoubleKeyFrame KeyTime="0" Value="1"/>
                                                                        </DoubleAnimationUsingKeyFrames>
                                                                        <ColorAnimationUsingKeyFrames Storyboard.TargetName="BackgroundGradient2" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[1].(GradientStop.Color)">
                                                                            <SplineColorKeyFrame KeyTime="0" Value="#E5FFFFFF"/>
                                                                        </ColorAnimationUsingKeyFrames>
                                                                        <ColorAnimationUsingKeyFrames Storyboard.TargetName="BackgroundGradient2" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[2].(GradientStop.Color)">
                                                                            <SplineColorKeyFrame KeyTime="0" Value="#BCFFFFFF"/>
                                                                        </ColorAnimationUsingKeyFrames>
                                                                        <ColorAnimationUsingKeyFrames Storyboard.TargetName="BackgroundGradient2" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[3].(GradientStop.Color)">
                                                                            <SplineColorKeyFrame KeyTime="0" Value="#6BFFFFFF"/>
                                                                        </ColorAnimationUsingKeyFrames>
                                                                        <ColorAnimationUsingKeyFrames Storyboard.TargetName="BackgroundGradient2" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[0].(GradientStop.Color)">
                                                                            <SplineColorKeyFrame KeyTime="0" Value="#F2FFFFFF"/>
                                                                        </ColorAnimationUsingKeyFrames>
                                                                    </Storyboard>
                                                                </vsm:VisualState>
                                                                <vsm:VisualState x:Name="Unchecked"/>
                                                            </vsm:VisualStateGroup>
                                                            <vsm:VisualStateGroup x:Name="FocusStates">
                                                                <vsm:VisualState x:Name="Focused">
                                                                    <Storyboard>
                                                                        <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="FocusVisualElement" Storyboard.TargetProperty="Visibility">
                                                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                                                <DiscreteObjectKeyFrame.Value>
                                                                                    <Visibility>Visible</Visibility>
                                                                                </DiscreteObjectKeyFrame.Value>
                                                                            </DiscreteObjectKeyFrame>
                                                                        </ObjectAnimationUsingKeyFrames>
                                                                    </Storyboard>
                                                                </vsm:VisualState>
                                                                <vsm:VisualState x:Name="Unfocused"/>
                                                            </vsm:VisualStateGroup>
                                                        </vsm:VisualStateManager.VisualStateGroups>
                                                        <Rectangle x:Name="BackgroundOverlay" Opacity="0" Fill="{StaticResource YColorDarkLight}" Stroke="#00000000" StrokeThickness="{TemplateBinding BorderThickness}" RadiusX="5" RadiusY="5"/>
                                                        <Rectangle x:Name="BackgroundOverlay2" Opacity="0" Fill="{StaticResource YColorDarkLightOver}" Stroke="#00000000" StrokeThickness="{TemplateBinding BorderThickness}" RadiusX="5" RadiusY="5"/>
                                                        <Rectangle Margin="{TemplateBinding BorderThickness}" x:Name="BackgroundGradient" Stroke="#FFFFFFFF" StrokeThickness="1" RadiusX="3" RadiusY="3" Fill="{StaticResource YLightBackDown}"/>
                                                        <Rectangle x:Name="BackgroundOverlay3" Opacity="0" Fill="{StaticResource YLightBack}" Stroke="#00000000" StrokeThickness="{TemplateBinding BorderThickness}" RadiusX="5" RadiusY="5"/>
                                                        <Rectangle Margin="{TemplateBinding BorderThickness}" x:Name="BackgroundGradient2" Opacity="0" Stroke="#FFFFFFFF" StrokeThickness="1" RadiusX="3" RadiusY="3">
                                                            <Rectangle.Fill>
                                                                <LinearGradientBrush EndPoint=".7,1" StartPoint=".7,0">
                                                                    <GradientStop Color="#FFFFFFFF" Offset="0"/>
                                                                    <GradientStop Color="#F9FFFFFF" Offset="0.375"/>
                                                                    <GradientStop Color="#E5FFFFFF" Offset="0.625"/>
                                                                    <GradientStop Color="#C6FFFFFF" Offset="1"/>
                                                                </LinearGradientBrush>
                                                            </Rectangle.Fill>
                                                        </Rectangle>
                                                        <Rectangle Margin="{TemplateBinding BorderThickness}" x:Name="Highlight" IsHitTestVisible="false" Opacity="1" Stroke="{StaticResource YBorderLight}" StrokeThickness="1" RadiusX="3" RadiusY="3"/>
                                                        <ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" x:Name="contentPresenter" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" Content="{TemplateBinding Content}" ContentTemplate="{TemplateBinding ContentTemplate}"/>
                                                        <Rectangle x:Name="DisabledVisualElement" IsHitTestVisible="false" Opacity="0" Fill="#A5FFFFFF" RadiusX="3" RadiusY="3"/>
                                                        <Rectangle x:Name="FocusVisualElement" IsHitTestVisible="false" Visibility="Collapsed" Stroke="{StaticResource YBorderLight}" StrokeThickness="1" RadiusX="3.5" RadiusY="3.5"/>
                                                    </Grid>
                                                </ControlTemplate>
                                            </Setter.Value>
                                        </Setter>
                                    </Style>
                                </Grid.Resources>
                                <vsm:VisualStateManager.VisualStateGroups>
                                    <vsm:VisualStateGroup x:Name="CommonStates">
                                        <vsm:VisualStateGroup.Transitions>
                                            <vsm:VisualTransition GeneratedDuration="00:00:00.1"/>
                                        </vsm:VisualStateGroup.Transitions>
                                        <vsm:VisualState x:Name="Normal"/>
                                        <vsm:VisualState x:Name="MouseOver"/>
                                        <vsm:VisualState x:Name="Disabled">
                                            <Storyboard>
                                                <DoubleAnimationUsingKeyFrames Storyboard.TargetName="DisabledVisualElement" Storyboard.TargetProperty="(UIElement.Opacity)">
                                                    <SplineDoubleKeyFrame KeyTime="00:00:00" Value="1"/>
                                                </DoubleAnimationUsingKeyFrames>
                                            </Storyboard>
                                        </vsm:VisualState>
                                    </vsm:VisualStateGroup>
                                    <vsm:VisualStateGroup x:Name="FocusStates">
                                        <vsm:VisualState x:Name="Focused">
                                            <Storyboard>
                                                <DoubleAnimationUsingKeyFrames Storyboard.TargetName="FocusVisualElement" Storyboard.TargetProperty="(UIElement.Opacity)">
                                                    <SplineDoubleKeyFrame KeyTime="00:00:00" Value="1"/>
                                                </DoubleAnimationUsingKeyFrames>
                                            </Storyboard>
                                        </vsm:VisualState>
                                        <vsm:VisualState x:Name="Unfocused"/>
                                        <vsm:VisualState x:Name="FocusedDropDown">
                                            <Storyboard>
                                                <ObjectAnimationUsingKeyFrames Duration="00:00:00" Storyboard.TargetName="PopupBorder" Storyboard.TargetProperty="(UIElement.Visibility)">
                                                    <DiscreteObjectKeyFrame KeyTime="00:00:00">
                                                        <DiscreteObjectKeyFrame.Value>
                                                            <Visibility>Visible</Visibility>
                                                        </DiscreteObjectKeyFrame.Value>
                                                    </DiscreteObjectKeyFrame>
                                                </ObjectAnimationUsingKeyFrames>
                                            </Storyboard>
                                        </vsm:VisualState>
                                    </vsm:VisualStateGroup>
                                </vsm:VisualStateManager.VisualStateGroups>
                                <Border x:Name="ContentPresenterBorder" Background="{StaticResource YBorderDark}" CornerRadius="3,3,3,3">
                                    <Grid>
                                        <ToggleButton Background="{StaticResource YLightBack}" BorderBrush="{StaticResource YBorderLight}" BorderThickness="{TemplateBinding BorderThickness}" HorizontalContentAlignment="Right" HorizontalAlignment="Stretch" Margin="-1" x:Name="DropDownToggle" Style="{StaticResource comboToggleStyle}" VerticalAlignment="Stretch">
                                            <Path Height="4" HorizontalAlignment="Right" Margin="0,0,6,0" x:Name="BtnArrow" Width="8" Stretch="Uniform" Data="F1 M 301.14,-189.041L 311.57,-189.041L 306.355,-182.942L 301.14,-189.041 Z " Fill="{StaticResource YBorderDark}"/>
                                        </ToggleButton>
                                        <ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" x:Name="ContentPresenter" VerticalAlignment="{TemplateBinding VerticalContentAlignment}">
                                            <TextBlock Text=" " Foreground="{StaticResource YTextColor}"/>
                                        </ContentPresenter>
                                    </Grid>
                                </Border>
                                <Rectangle x:Name="DisabledVisualElement" IsHitTestVisible="false" Opacity="0" Fill="#A5FFFFFF" RadiusX="3" RadiusY="3"/>
                                <Rectangle x:Name="FocusVisualElement" IsHitTestVisible="false" Opacity="0" Stroke="{StaticResource YBorderLight}" StrokeThickness="1" RadiusX="3" RadiusY="3"/>
                                <Popup x:Name="Popup">
                                    <Border Height="Auto" HorizontalAlignment="Stretch" x:Name="PopupBorder" BorderBrush="{StaticResource YBorderLight}" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="3" Margin="0,2,0,0">
                                        <Border.Background>
                                            <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                                                <GradientStop Color="#FFFFFFFF" Offset="0"/>
                                                <GradientStop Color="#FFFEFEFE" Offset="1"/>
                                            </LinearGradientBrush>
                                        </Border.Background>
                                        <ScrollViewer BorderThickness="0" Padding="1" x:Name="ScrollViewer" Style="{StaticResource ScrollViewerCaramel}">
                                            <ItemsPresenter/>
                                        </ScrollViewer>
                                    </Border>
                                </Popup>
                            </Grid>
                        </ControlTemplate>
                    </Setter.Value>
                </Setter>
            </Style>

        <Style x:Key="BoxItemCaramel" TargetType="ListBoxItem">
            <Setter Property="Padding" Value="3"/>
            <Setter Property="HorizontalContentAlignment" Value="Left"/>
            <Setter Property="VerticalContentAlignment" Value="Top"/>
            <Setter Property="Background" Value="Transparent"/>
            <Setter Property="BorderThickness" Value="1"/>
            <Setter Property="TabNavigation" Value="Local"/>
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="ListBoxItem">
                        <Grid Background="{TemplateBinding Background}" Margin="0,0,0,0">
                            <vsm:VisualStateManager.VisualStateGroups>
                                <vsm:VisualStateGroup x:Name="CommonStates">
                                    <vsm:VisualState x:Name="Normal"/>
                                    <vsm:VisualState x:Name="MouseOver">
                                        <Storyboard>
                                            <DoubleAnimationUsingKeyFrames Storyboard.TargetName="fillColor" Storyboard.TargetProperty="Opacity">
                                                <SplineDoubleKeyFrame KeyTime="0" Value=".35"/>
                                            </DoubleAnimationUsingKeyFrames>
                                        </Storyboard>
                                    </vsm:VisualState>
                                </vsm:VisualStateGroup>
                                <vsm:VisualStateGroup x:Name="SelectionStates">
                                    <vsm:VisualState x:Name="Unselected"/>
                                    <vsm:VisualState x:Name="Selected">
                                        <Storyboard>
                                            <DoubleAnimationUsingKeyFrames Storyboard.TargetName="fillColor2" Storyboard.TargetProperty="Opacity">
                                                <SplineDoubleKeyFrame KeyTime="0" Value=".75"/>
                                            </DoubleAnimationUsingKeyFrames>
                                        </Storyboard>
                                    </vsm:VisualState>
                                </vsm:VisualStateGroup>
                                <vsm:VisualStateGroup x:Name="FocusStates">
                                    <vsm:VisualState x:Name="Focused">
                                        <Storyboard>
                                            <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="FocusVisualElement" Storyboard.TargetProperty="Visibility">
                                                <DiscreteObjectKeyFrame KeyTime="0">
                                                    <DiscreteObjectKeyFrame.Value>
                                                        <Visibility>Visible</Visibility>
                                                    </DiscreteObjectKeyFrame.Value>
                                                </DiscreteObjectKeyFrame>
                                            </ObjectAnimationUsingKeyFrames>
                                        </Storyboard>
                                    </vsm:VisualState>
                                    <vsm:VisualState x:Name="Unfocused"/>
                                </vsm:VisualStateGroup>
                            </vsm:VisualStateManager.VisualStateGroups>
                            <Rectangle x:Name="fillColor" IsHitTestVisible="False" Opacity="0" RadiusX="3" RadiusY="3" Fill="{StaticResource YLightBack}"/>
                            <Rectangle x:Name="fillColor2" IsHitTestVisible="False" Opacity="0" Fill="{StaticResource YLightBack}" RadiusX="3" RadiusY="3" Stroke="{StaticResource YBorderLight}"/>
                            <ContentPresenter HorizontalAlignment="Left" Margin="{TemplateBinding Padding}" x:Name="contentPresenter" Content="{TemplateBinding Content}" ContentTemplate="{TemplateBinding ContentTemplate}"/>
                            <Rectangle x:Name="FocusVisualElement" Visibility="Collapsed" Stroke="{StaticResource YBorderLight}" StrokeThickness="1" RadiusX="3" RadiusY="3"/>
                        </Grid>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>

        <!--************** Caramel styles end ************** -->

 
        </Application.Resources>
</Application>
